<%-- 
    Document   : homepage
    Created on : 02-03-2012, 21:21:21
    Author     : Xe Bay
--%>

<%@page import="javax.xml.transform.Transformer"%>
<%@page import="javax.xml.transform.OutputKeys"%>
<%@page import="javax.xml.transform.Transformer"%>
<%@page import="javax.xml.transform.Transformer"%>
<%@page import="javax.xml.transform.TransformerFactory"%>
<%@page import="javax.xml.transform.stream.StreamResult"%>
<%@page import="java.io.File"%>
<%@page import="javax.xml.transform.stream.StreamSource"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml"  prefix="x" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<!-- use two files: XML data and XSL styleshhet -->

<html>

    <head>
        <title>Home Page</title>
        <link rel="stylesheet" type="text/css" href="style.css" title="style"/>
        <link rel="stylesheet" type="text/css" href="popup.css" title="style"/>
        <script type="text/javascript" src="script/common.js"></script>
        <script type="text/javascript" src="script/search.js"></script>
        <script type="text/javascript" src="script/tab.js"></script>
        <script type="text/javascript" src="script/popup.js"></script>
        <script type="text/javascript" src="script/checkRegister.js"></script>
        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    </head>
    <body onload="refreshDsTinDang()">
        <script type="text/javascript">
            <c:import url="xml/Tindang.xml" var="xml" charEncoding="UTF-8"/>
                var textOfTinDang='${xml}';
                var tindangDoc = stringtoXML(textOfTinDang);
        </script>
        <jsp:include page="popupDangNhap.jsp" flush="true"/>
        <jsp:include page="popupDangki.jsp" flush="true"/>
        <jsp:include page="lienhe.jsp" flush="true"/>

        <div id="userinfo" style="margin-left: 1000px">
            <logic:present name="LoginActionForm" property="nguoiDung">
                Xin chào, ${sessionScope.LoginActionForm.nguoiDung.ho} ${sessionScope.LoginActionForm.nguoiDung.ten} (<a href="logout.do">Đăng xuất</a>)
            </logic:present>
            <logic:notPresent name="LoginActionForm" property="nguoiDung">
                <a href="javaScript: showHidePopup('dangnhapFormPopup','block');">Đăng nhập</a>
                |
                <a href="javaScript: showHidePopup('popupRegister','block');">Đăng kí</a>
            </logic:notPresent>
        </div>

        <div id="wrapper">
            <div id="header">
                <div id="logo">
                    <h1><a href="#">Nhà Đất</a></h1>
                </div>
                <div id="menu">
                    <ul>
                        <li class="first current_page_item"><a href="homepage.do">Trang Chủ</a></li>
                        <li><a href="tinHot.do">Tin Nổi Bật</a></li>
                        <li><a href="tinmoi.do">Tin Mới</a></li>
                        <li><a href="#">Thông Tin Cty</a></li>
                        <li class="last"><a href="#"><a href="javaScript: showHidePopup('lienhe','block');">Liên Hệ</a></a></li>
                    </ul>
                    <br class="clearfix" />
                </div>
            </div>
            <div style="margin-left:800px">
                <logic:present name="LoginActionForm" property="nguoiDung">

                    <a href="taotindang.do">Đăng Tin</a> | <a href="quanlytindang.do">Quản Lý Tin Đăng</a>

                </logic:present>
            </div>
            <div id="page">
                <jsp:include page="searchForm.jsp" flush="true"/>
                <div id="contentNew">
                    <div class="box">
                        <div style="border:1px solid black; padding-left:20px; padding-bottom:10px; padding-top:10px ">
                            <center>
                                <h3 id="h3_tinmoinhat">Tin Mới Nhất</h3><br/>
                                <div id="nevigatorOfSearching" style="display: none">
                                    Kết quả từ <span id="span_ketquaFrom" style="font-size: 14pt"></span> đến <span id="span_ketquaTo" style="font-size: 14pt"></span><br/>
                                    <input id="truocSearchButton" type="button" value="Trước" onclick="showketquatruoc()" style="width: 50px;"/>
                                    <input id="sauSearchButton" type="button" value="Sau" onclick="showketquasau()" style="width: 50px"/>
                                </div>
                            </center>
                            <div class="TabView" id="TabView">
                                <div class="Tabs" style="width: 550px;"> <a id="tabCanBan">Cần bán</a> <a id="tabCanMua">Cần mua</a> <a id="tabChoThue">Cho thuê</a> <a id="tabCanThue">Cần thuê</a> </div>
                                <!------------------------------------------------------------------------------------->
                                <hr/>
                                <div class="Pages" style="width: 550px; height: 1050px;">
                                    <div class="Page">
                                        <div class="Pad">
                                            <c:import url="xsl/tinNew_Ban.xsl" var="xslt" charEncoding="UTF-8"/>
                                            <x:transform xml="${xml}" xslt="${xslt} "/>



                                        </div>
                                    </div>
                                    <div class="Page">
                                        <div class="Pad">
                                            <c:import url="xsl/tinNew_Mua.xsl" var="xslt" charEncoding="UTF-8"/>
                                            <x:transform xml="${xml}" xslt="${xslt} "/>
                                        </div>
                                    </div>
                                    <div class="Page">
                                        <div class="Pad">
                                            <c:import url="xsl/tinNew_ChoThue.xsl" var="xslt" charEncoding="UTF-8"/>
                                            <x:transform xml="${xml}" xslt="${xslt} "/>
                                        </div>
                                    </div>
                                    <div class="Page">
                                        <div class="Pad">
                                            <c:import url="xsl/tinNew_CanThue.xsl" var="xslt" charEncoding="UTF-8"/>
                                            <x:transform xml="${xml}" xslt="${xslt} "/>
                                        </div>
                                    </div>
                                </div>
                            </div>


                        </div>
                    </div>
                </div>


                <div id="sidebarHot">
                    <div class="box">
                        <div style="border:1px solid black; padding-left:10px; padding-bottom:10px; padding-top:10px ">
                            <center><h3>Tin Xem Nhiều Nhất</h3><br/></center>
                            <hr/>
                            <c:import url="xsl/tinHot.xsl" var="xslt" charEncoding="UTF-8"/>

                            <x:transform xml="${xml}" xslt="${xslt} "/>
                        </div>
                    </div>

                </div>

            </div>
        </div>

        <div id="footer">
        </div>
        <script type="text/javascript">
            tabview_initialize('TabView');
        </script>
    </body>
</html>



